<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="zh-CN">
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Move</title>
	<link rel="stylesheet" href="../css/Register.css" type="text/css" />
	<script type="text/javascript" src="../js/jquery-1.4.2.js"></script>
	<script type="text/javascript">
$(window).ready(function(){
$('#submit').click(function () {
	if ($('#username').val() == "" || $('#password').val() == "" || $('#password-commit').val() == "" || $('#email').val() == "") {
		alert("输入内容不能为空");
		return;
	}
	if ($('#password').val() != $('#password-commit').val()) {
		alert("两次密码不一致");
		return;
	}
	else {
		$.ajax({
			type: "POST",
			url: "/hitjimo/register",
			data: "username=" + escape($('#username').val()) + "&password=" + escape($('#password').val()) + "&email=" + escape($('#email').val()) ,
			beforeSend: function () {
			},
			success: function (msg) {
				if (msg == "success") {
					alert("注册成功");
					window.location.href="/hitjimo/html/Move.html";
				}
				if (msg == "fail") {
					alert("注册失败");
					window.location.href="/hitjimo/html/Register.html";
				}
			},
			complete: function (data) {
				//$("#loading").css("display", "none"); //�����¼����ʾloading�����������
				//$("#login").css("display", "block");
 			},
			error: function (XMLHttpRequest, textStatus, thrownError) {
   			}
		});
	}
});
})
	 </script>
	</head>
  
	<body>
	<div id="login">
	    <h1>打寂寞注册</h1>
	    <fieldset id="inputs">
	        <input id="username" type="text" placeholder="用户名" autofocus required>
	        <input id="password" type="password" placeholder="密码" required>
	        <input id="password-commit" type="password" placeholder="密码确认" required>
	        <input id="email" type="text" placeholder="E-MAIL" required>
	    </fieldset>
	    <fieldset id="actions">
	        <input type="submit" id="submit" value="注册">
	        <input type="submit" id="return" value="返回上一页面" onclick="history.back();">
	    </fieldset>
	</div>
	<div id="container"  style="display: none; background-color:#000000" onmouseover="restart()" onmouseout="pause()" >
		<canvas id="canvas">
		  <p>Your browser does not support the canvas element.</p>
	  </canvas>
	</div>
	</body>
</html>
